package com.luotao.test.db;

import com.luotao.devp.base.db.BaseDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * User: luotao
 * Date: 12-5-5
 * Time: 下午9:13
 * To change this template use File | Settings | File Templates.
 */
@Service
public class UserService {

    private static final String SQL_USER_INSERT = "insert into trade_user(loginname,loginpass,nickname,mobile) values(?,?,?,?)";

    private static final String SQL_USER_DELETE = "delete from trade_user";

    private BaseDao baseDao;

    @Autowired
    public void setBaseDao(BaseDao baseDao) {
        this.baseDao = baseDao;
    }

    public void saveUser(Map<String,String> value){
        baseDao.update(SQL_USER_INSERT,value.values().toArray());
    }

    public void deleteUser(){
       baseDao.update(SQL_USER_DELETE);
    }
}
